package com.wejoy.video.middle.station.admin.controller.screen;

import com.wejoy.video.middle.station.admin.controller.BaseController;
import com.wejoy.video.middle.station.admin.util.CurrentUserUtils;
import com.wejoy.video.middle.station.data.domain.PageResult;
import com.wejoy.video.middle.station.data.domain.screen.ScreenUserCarmeraConfig;
import com.wejoy.video.middle.station.data.domain.system.SysUser;
import com.wejoy.video.middle.station.data.service.screen.IScreenUserCarmeraConfigService;
import com.wejoy.video.middle.station.data.util.WJAssert;
import com.wejoy.video.middle.station.data.vo.RespJSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.ArrayList;

/**
 * 用户大屏监控记忆配置 
 *
 * @author miracle_j
 * @date 2024年11月30日 14:15:42
 */
@RestController
@RequestMapping("/screen/screenUserCarmeraConfig")
public class ScreenUserCarmeraConfigController extends BaseController {

    @Autowired
    private IScreenUserCarmeraConfigService screenUserCarmeraConfigService;

    /**
     * 保存或更新
     *
     * @param screenUserCarmeraConfigReq screenUserCarmeraConfigReq
     * @return RespJSON
     */
    @PostMapping("/save")
    public RespJSON save(@RequestBody ScreenUserCarmeraConfig screenUserCarmeraConfigReq, @SessionAttribute(CurrentUserUtils.SYSTEM_USER) SysUser loginSysUser) {
        screenUserCarmeraConfigReq.setUserId(loginSysUser.getId());
        screenUserCarmeraConfigReq.setPointId(screenUserCarmeraConfigReq.getPointId().replaceAll("\\s+", ""));
        screenUserCarmeraConfigService.save(screenUserCarmeraConfigReq, loginSysUser.getUserName());
        return RespJSON.success();
    }

}
